package com.zh.juc.callback;

import java.util.concurrent.TimeUnit;

/**
 * @Author: zhanghuan
 * @date: 2022/10/9 19:01
 * @description: create it
 */
public class Son2 {
    private CallListener listener;

    public void registerListener(CallListener listener) {
        this.listener = listener;
    }

    public void ride() {
        //3.
        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //4.
        listener.call();
    }
}
